<?php
  session_start();
  require_once "public/Conn.php";
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>网上书店</title>
</head>
<body>
  <?php
    include 'public/HeaderNav.php'
  ?>
  <div class="Index-container">
    <ul>
      <?php
        $hrefs = ['Products.php','javascript:;','javascript:;','javascript:;','javascript:;'];
        $sql = "SELECT Name,Image FROM category";
        $result = $db->query($sql);
        // var_dump($result);
        $index = 0;
        while($row = $result->fetch_assoc()){
          echo '<li><a href="'.$hrefs[$index].'"><img src="./image/'.$row['Image'].'" ><label>'.$row['Name'].'</label>';
          $index++;
        }
      ?>
			
    </ul>
  </div>
  <?php
    include 'public/Footer.html'
  ?>
</body>
</html>